/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2021-10-14 23:34:40
 */
import Vue from 'vue'

/**
 * 判断移动端
 * @returns {Boolean}
 */
export const isMobile = function() {
  return !Vue.prototype.$isServer && !!navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)
}

/**
 * 判断IE浏览器
 * @returns {Boolean}
 */
export const isIE = function() {
  return !Vue.prototype.$isServer && !isNaN(Number(document.documentMode))
}

/**
 * 判断Edge浏览器
 * @returns {Boolean}
 */
export const isEdge = function() {
  return !Vue.prototype.$isServer && navigator.userAgent.indexOf('Edge') > -1
}

/**
 * 判断火狐浏览器
 * @returns {Boolean}
 */
export const isFirefox = function() {
  return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/firefox/i)
}

/**
 * 判断谷歌浏览器
 * @returns {Boolean}
 */
export const isChrome = function() {
  return !Vue.prototype.$isServer && !!window.navigator.userAgent.match(/Chrome/i)
}
